<template>
  <div class="inquiryForm">
    <el-col :span="24" class="toolbar" style="padding-bottom: 0px">
      <el-form :inline="true">
        <el-form-item>
          <el-button type="primary" @click="showDialog" v-show="!dataDetail.id">新增</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="info" @click="editForm" :disabled="!isRead"
            >修改</el-button
          >
        </el-form-item>
        <!-- <el-form-item>
          <el-button type="warning">删除</el-button>
        </el-form-item>-->
        <!-- <el-form-item
          v-show="!isRead && (!dataDetail.type || dataDetail.type == 0 || dataDetail.type == 1)"
        >
          <el-button type="primary" @click="saveFile">保存</el-button>
        </el-form-item>-->
        <el-form-item v-show="dataDetail.id">
          <el-button type="primary" @click="saveFile">保存</el-button>
        </el-form-item>
        <!-- <el-form-item v-show="isRead && dataDetail.type == 1">
          <el-button type="primary" @click="submitForm">提交</el-button>
        </el-form-item>-->
        <el-form-item v-show="dataDetail.id">
          <el-button type="primary" @click="submitForm">提交</el-button>
        </el-form-item>
        <el-form-item v-show="dataDetail.id">
          <el-button type="primary" @click="withdrawList">撤回</el-button>
        </el-form-item>
        <el-form-item>
          <!-- 导出 -->
          <exportBtn
            :url="'wlcSysAll/checkOut'"
            :sendData="dataDetail"
            :state="2"
          ></exportBtn>
        </el-form-item>
        <el-form-item
          v-if="
            !dataDetail.type ||
            dataDetail.type == 0 ||
            dataDetail.type == 1 ||
            dataDetail.type == 2
          "
        >
          <el-button type="primary" @click="saveDraft">存为草稿</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="success" @click="chooseDraft">选择草稿</el-button>
        </el-form-item>
        <el-form-item>
          <el-button
            type="success"
            @click="lookProcess"
            v-if="dataDetail.type && dataDetail.type != 0"
            >查审</el-button
          >
        </el-form-item>
      </el-form>
    </el-col>
    <el-col :span="24" class="toolbar">
      <div class="apply-data">
        <div class="ad-item">
          <div class="tit">询价单号:</div>
          <div class="text">{{ dataDetail.orderNum }}</div>
        </div>
        <div class="ad-item">
          <div class="tit">申请日期:</div>
          <div class="text">{{ dataDetail.uploadDay }}</div>
        </div>
        <div class="ad-item">
          <div class="tit">公司:</div>
          <div class="text">{{ dataDetail.unitname }}</div>
        </div>
        <div class="ad-item">
          <div class="tit">部门:</div>
          <div class="text">{{ dataDetail.deptname }}</div>
        </div>
        <div class="ad-item">
          <div class="tit">询价员:</div>
          <div class="text">{{ dataDetail.psnname }}</div>
        </div>
        <div class="ad-item">
          <div class="tit">需求日期:</div>
          <div class="text">{{ dataDetail.needDay }}</div>
        </div>
        <div class="ad-item">
          <div class="tit">采购类型:</div>
          <div class="text" v-if="dataDetail.buyType == 0">紧急采购</div>
          <div class="text" v-if="dataDetail.buyType == 1">零星采购</div>
          <div class="text" v-if="dataDetail.buyType == 2">合同采购</div>
        </div>
      </div>
    </el-col>
    <el-table :data="tableData" style="width: 100%" border row-key="id">
      <el-table-column
        label="序号"
        type="index"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="productName"
        label="产品名称"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="file"
        label="附件(询价)"
        width="140"
        align="center"
      >
        <template slot-scope="scope">
          <div v-if="scope.row.inquiryProductUrl">
            <el-button
              @click="showImg(scope.row.inquiryProductUrl)"
              size="small"
              type="primary"
              >查看</el-button
            >
          </div>
          <div @click="getIndex(scope)" v-else>
            <el-upload
              class="upload-demo"
              action="https://jsonplaceholder.typicode.com/posts/"
              :auto-upload="false"
              :on-change="uploadFile"
              :on-remove="removeFile"
              :show-file-list="false"
            >
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">
                只能上传jpg/png文件，且不超过50kb
              </div>
            </el-upload>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        prop="invspec"
        label="规格型号"
        align="center"
      ></el-table-column>
      <el-table-column label="*供应商" align="center" width="150px">
        <template slot-scope="scope">
          <!-- <el-input :readonly="isRead" v-model="scope.row.custname" placeholder="供应商"></el-input> -->
          <el-select
            v-model="scope.row.supplierString"
            @change="changeSupplier(scope)"
            filterable
            placeholder="请选择"
          >
            <el-option
              v-for="item in supplierArr"
              :key="item.id"
              :label="item.supplierName"
              :value="item.id + ',' + item.supplierName"
            ></el-option>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column
        prop="unitweight"
        label="质量标准"
        align="center"
      ></el-table-column>
      <el-table-column label="历史" align="center">
        <el-table-column
          prop="historical"
          label="采购量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="histMaxMoney"
          label="最高价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="histMinMoney"
          label="最低价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="histAvgMoney"
          label="平均价"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="contractPrice"
          label="合同价"
          align="center"
        ></el-table-column>
        <el-table-column label="是否含运费" align="center">
          <template slot-scope="scope">
            <p>是</p>
          </template>
        </el-table-column>
        <el-table-column label="付款方式" align="center">
          <template slot-scope="scope">
            <p>转账</p>
          </template>
        </el-table-column>
        <el-table-column
          prop="histEvaluate"
          label="历史评价"
          align="center"
        ></el-table-column>
      </el-table-column>

      <el-table-column
        prop="requisitionsHowUse"
        label="用途"
        align="center"
      ></el-table-column>

      <el-table-column label="*单价(元)" align="center" width="210">
        <template slot-scope="scope">
          <el-input-number
            v-model="scope.row.inquiryUnitPrice"
            :min="0"
            :disabled="isRead"
            :max="999999999999999999"
            placeholder="单价"
            @change="changePic(scope)"
          ></el-input-number>
        </template>
      </el-table-column>
      <el-table-column
        prop="measurement"
        label="单位"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="requisitionsHowMany"
        label="数量"
        align="center"
      ></el-table-column>
      <el-table-column label="*税率(询价)" align="center" width="210">
        <template slot-scope="scope">
          <el-input-number
            v-model="scope.row.inquiryTaxRate"
            :min="0"
            :disabled="isRead"
            :max="1"
            placeholder="税率"
          ></el-input-number>
        </template>
      </el-table-column>
      <el-table-column label="*总价(元)" align="center" width="210">
        <template slot-scope="scope">
          <el-input-number
            v-model="scope.row.inquiryAllMoneys"
            :min="0"
            :disabled="isRead"
            :max="999999999999999999"
            placeholder="总价"
          ></el-input-number>
        </template>
      </el-table-column>
      <el-table-column label="*是否含运费(询价)" align="center" width="140">
        <template slot-scope="scope">
          <el-select
            :disabled="isRead"
            v-model="scope.row.inquiryIsFreight"
            placeholder="请选择"
          >
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column label="付款方式(询价)" align="center" width="140">
        <template slot-scope="scope">
          <el-input
            :maxlength="15"
            :readonly="isRead"
            v-model="scope.row.inquiryPayType"
            placeholder="付款方式"
          ></el-input>
        </template>
      </el-table-column>
      <el-table-column label="地址及联系方式(询价)" align="center" width="200">
        <template slot-scope="scope">
          <el-input
            :maxlength="255"
            :readonly="isRead"
            v-model="scope.row.inquiryAddressPhone"
            placeholder="地址及联系方式"
            type="textarea"
            autosize
            resize="none"
          ></el-input>
        </template>
      </el-table-column>
      <el-table-column
        prop="requisitionsNowHave"
        label="现有库存"
        align="center"
      ></el-table-column>
      <!-- 未知字段 -->
      <el-table-column
        label="保质期"
        prop="avgs"
        align="center"
      ></el-table-column>
      <el-table-column label="备注" align="center" width="220">
        <template slot-scope="scope">
          <el-input
            :maxlength="255"
            :readonly="isRead"
            v-model="scope.row.inquiryRemark"
            placeholder="提示：文字：XXXX ; 购买链接：http://XX.XX"
            type="textarea"
            :autosize="{maxRows: 2}"
            resize="none"
          ></el-input>
        </template>
      </el-table-column>
      <!-- 请购单数据 -->
      <el-table-column
        label="请购单数据"
        align="center"
        :label-class-name="'labelFont'"
      >
        <el-table-column prop="file" label="附件" width="140" align="center">
          <template slot-scope="scope">
            <div>
              <el-button
                @click="showImg(scope.row.productUrl)"
                size="small"
                type="primary"
                >查看</el-button
              >
            </div>
          </template>
        </el-table-column>
        <el-table-column label="供应商" prop="supplierName"></el-table-column>
        <el-table-column
          label="单价(元)"
          align="center"
          prop="requisitionsUnitPrice"
        ></el-table-column>
        <el-table-column
          label="税率(元)"
          align="center"
          prop="requisitionsTaxRate"
        ></el-table-column>
        <el-table-column label="是否含运费" align="center">
          <template slot-scope="scope">
            <div>
              {{ scope.row.requisitionsIsFreight == "Y" ? "是" : "否" }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          label="付款方式"
          align="center"
          prop="requisitionsPayType"
        ></el-table-column>
        <el-table-column
          label="地址及联系方式"
          align="center"
          prop="requisitionsAddressPhone"
        ></el-table-column>
        <el-table-column
          label="用途"
          align="center"
          prop="requisitionsHowUse"
        ></el-table-column>
        <el-table-column
          label="本期申请数量"
          align="center"
          prop="requisitionsHowMany"
        ></el-table-column>
        <el-table-column
          label="总价"
          align="center"
          prop="inquiryAllMoneys"
        ></el-table-column>
        <el-table-column
          label="备注"
          align="center"
          prop="requisitionsRemark"
        ></el-table-column>
      </el-table-column>
    </el-table>
    <!-- 选择请购单弹窗 -->
    <el-dialog
      title="请购单列表"
      :visible.sync="dialogTableVisible"
      width="80%"
      top="7vh"
    >
      <div class="diaSearch">
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="商品名称:">
            <el-input
              v-model="formInline.productName"
              placeholder="商品名称"
            ></el-input>
          </el-form-item>
          <el-form-item label="待我询价:">
            <el-select v-model="formInline.isNeedMe" placeholder="请选择">
              <el-option label="全部" value="0"></el-option>
              <el-option label="待我询价" value="1"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">查询</el-button>
          </el-form-item>
        </el-form>
      </div>
      <el-table :data="productList" height="50vh" ref="multipleTable">
        <!-- <el-table-column type="selection" width="55" align="center" fixed></el-table-column> -->
        <el-table-column
          property="unitname"
          label="公司"
          align="center"
        ></el-table-column>
        <el-table-column
          property="custname"
          label="建议供应商"
          align="center"
        ></el-table-column>
        <el-table-column
          property="psnname"
          label="请购人"
          align="center"
        ></el-table-column>
        <el-table-column label="选择" align="center">
          <template slot-scope="scope">
            <el-button
              size="small"
              type="primary"
              @click="handleSelectionChange(scope.row)"
              >选择</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <!-- 选择草稿 -->
    <el-dialog
      title="选择草稿"
      :visible.sync="dialogDraft"
      width="80%"
      top="7vh"
    >
      <div class="diaSearch">
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="草稿名称:">
            <el-input
              v-model="formInline.productName"
              placeholder="草稿名称"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">查询</el-button>
          </el-form-item>
        </el-form>
      </div>
      <el-table :data="draftList" height="50vh" ref="multipleTable">
        <el-table-column
          property="psnname"
          label="请购人"
          align="center"
        ></el-table-column>
        <el-table-column
          property="createtime"
          label="创建日期"
          align="center"
        ></el-table-column>
        <el-table-column
          property="orderNum"
          label="请购单号"
          align="center"
        ></el-table-column>
        <el-table-column align="center">
          <template slot-scope="scope">
            <el-button size="small" @click="draftSure(scope.row)"
              >选择</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <div class="page-size">
        <el-pagination
          background
          layout="prev, pager, next"
          :total="total"
          :page-size="page.pageSize"
          @current-change="changeSize"
        ></el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="sureProduct()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 查审弹窗 -->
    <el-dialog
      title="查审"
      :visible.sync="dialogInvestigate"
      width="40%"
      top="7vh"
    >
      <!-- <approvalProcess v-if="dialogInvestigate" :orderNum="dataDetail.orderNum" :id="dataDetail.id" :buyType="dataDetail.buyType" @hideInves="hideInves"></approvalProcess> -->
      <approvalProcess
        v-if="dialogInvestigate"
        :detail="dataDetail"
        @hideInves="hideInves"
      ></approvalProcess>
    </el-dialog>
    <!-- 展示图片 -->
    <el-dialog title="附件" :visible.sync="dialogImgShow">
      <div class="showImgDiv">
        <img :src="showImgUrl" alt />
      </div>
    </el-dialog>
    <el-col :span="24" class="toolbar">
      <div class="sign-remarks">
        <div class="tit">备注: {{ dataDetail.remark }}</div>
      </div>
    </el-col>
    <el-col :span="24" class="toolbar">
      <div class="sign-data">
        <div class="sd-item">制单人:{{ dataDetail.singlePerson }}</div>
        <div class="sd-item">审核人:{{ dataDetail.auditor }}</div>
        <div class="sd-item">
          审核时间:{{ formatTime(dataDetail.auditTime) }}
        </div>
        <div class="sd-item">变更人:{{ dataDetail.modifiername }}</div>
        <div class="sd-item">
          变更日期:{{ formatTime(dataDetail.modifytime) }}
        </div>
      </div>
    </el-col>
  </div>
</template>
<script>
import {
  poOrderList,
  getPrice,
  wlcSysAllAdd,
  wlcSysAllAuditSubmit,
  wlcSysAllListByDraft,
  wlcSysAllList,
  wlcSysAllRemove,
  wlcSysAllListByOrder,
  wlcSysInquirySeletelist,
  wlcSysBackListByAllId,
  wlcSysInquiryAdd,
  wlcSysInquirySubmit,
  wlcSysInquirySave,
  wlcSysInquiryListInquiry,
  wlcSysInquiryDetail,
  wlcSysInquiryUpdateAll,
  bdInvbasdocUploadImage,
  wlcSysBackWithdrawTicket,
  wlcSysInquiryWithdrawTicket,
} from "../../api/api";
import { supplierList } from "../../api/baseSetting";
import approvalProcess from "../components/approvalProcess";
import moment from "moment";
import exportBtn from "../components/exportBtn";
export default {
  components: {
    approvalProcess,
    exportBtn,
  },
  data() {
    return {
      //请购单数据
      tableData: [],
      //搜索商品的关键字
      formInline: {
        productName: "",
        isNeedMe: "0",
      },
      total: 0,
      isRead: false, //是否只读
      page: {
        page: 1,
        pageSize: 10,
      },
      productList: [], //商品列表
      dialogTableVisible: false, //显示可购买商品列表
      buyProduct: [], //选中要购买的商品
      // 请购单中被选择时间的那一条数据
      selectData: {
        data: {},
        index: null,
      },
      //请购单 被选中 选择附件的那一条数据
      uploadData: {
        data: {},
        index: null,
      },
      dialogDraft: false, //是否显示选择草稿的弹窗
      //供应商和采购类型
      typeData: {
        type: "",
        supplier: "",
        needDay: "",
      },
      //供应商列表
      supplierArr: [],
      dataDetail: {}, //从后端拿到的请购单详情
      draftList: [], //草稿列表
      dialogInvestigate: false, //是否显示查审
      showImgUrl: "",
      dialogImgShow: false, //是否展示图片
    };
  },
  mounted() {
    this.getList();
    this.getSupple();
    if (this.$route.query.id) {
      this.getDetail(this.$route.query.id);
    }
    this.getDraft(); //获取草稿列表
  },
  // 0：草稿，1：保存，2：待审批，3：废除，4：不通过，5：审核通过, 6:打开状态 , 7:关闭状态
  methods: {
    //撤回
    withdrawList() {
      this.$confirm("是否撤回?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        wlcSysBackWithdrawTicket([{ id: this.$route.query.id }]).then((res) => {
          // console.log(res);
          this.$message({
            type: "success",
            message: "撤回成功!",
          });
        });
      });
    },
    //输入单价  计算总价
    changePic(e) {
      let index = e.$index;
      this.tableData[index].inquiryAllMoneys =
        (e.row.inquiryUnitPrice || 0) * e.row.requisitionsHowMany;
    },
    //关闭查审
    hideInves() {
      this.dialogInvestigate = false;
    },
    //格式化时间
    formatTime(time) {
      if (time) {
        return moment(time).format("YYYY-MM-DD");
      } else {
        return "";
      }
    },
    //展示图片
    showImg(url) {
      if (url) {
        this.showImgUrl = url;
        this.dialogImgShow = true;
      } else {
        this.$message({
          message: "暂无图片",
          type: "warning",
        });
      }
    },
    //点击查审
    lookProcess() {
      this.dialogInvestigate = true;
    },
    //改变供应商
    changeSupplier(e) {
      var index = e.$index;
      var arr = this.tableData[index].supplierString.split(",");
      this.tableData[index].inquiryCustnameId = arr[0];
      this.tableData[index].inquiryCustname = arr[1];
      console.log(this.tableData[index]);
    },
    //点击选择草稿
    chooseDraft() {
      this.dialogDraft = true;
    },
    //草稿点击选择
    draftSure(data) {
      this.dialogDraft = false;
      this.getDetail(data.id, data.buyType);
    },
    //保存为草稿
    saveDraft() {
      this.$confirm("确认存为草稿?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var list = this.tableData;
          for (var i = 0; i < list.length; i++) {
            list[i].backId = list[i].id;
          }
          if (!this.dataDetail.id) {
            wlcSysInquirySave(list).then((res) => {
              wlcSysInquiryUpdateAll({
                allId: res.id,
                type: 0,
              }).then((res) => {
                this.$message({
                  message: "保存成功",
                  type: "success",
                });
                this.getDraft();
                this.getDetail(res.id, res.buyType);
              });
            });
          } else {
            wlcSysInquiryUpdateAll({
              allId: this.dataDetail.id,
              type: 0,
            }).then((res) => {
              this.$message({
                message: "保存成功",
                type: "success",
              });
              this.getDraft();
              this.getDetail(res.id, res.buyType);
            });
          }
        })
        .catch(() => {});
    },
    //点击修改
    editForm() {
      this.isRead = false;
    },
    //点击提交
    submitForm() {
      if (this.isRead) {
        wlcSysInquirySubmit({
          backId: this.dataDetail.wlcSysBack[0].id,
          type: 2,
        }).then((res) => {
          // this.getDetail(res.id, res.buyType);
          this.dataDetail = {};
          this.tableData = [];
          this.$message({
            message: "提交成功",
            type: "success",
          });
        });
      } else {
        this.saveFile(1);
      }
    },
    //保存文件
    saveFile(state) {
      var list = this.tableData;
      for (var i = 0; i < list.length; i++) {
        if (!list[i].supplierString) {
          this.$message({
            message: "请选择供应商",
            type: "warning",
          });
          return;
        }
        if (!list[i].inquiryUnitPrice) {
          this.$message({
            message: "请输入单价",
            type: "warning",
          });
          return;
        }
        if (!list[i].inquiryAllMoneys) {
          this.$message({
            message: "请输入总价",
            type: "warning",
          });
          return;
        }
        if (!list[i].inquiryTaxRate) {
          this.$message({
            message: "请输入税率",
            type: "warning",
          });
          return;
        }
        if (!list[i].inquiryIsFreight) {
          this.$message({
            message: "请选择是否含运费",
            type: "warning",
          });
          return;
        }
        list[i].backId = list[i].id;
      }
      wlcSysInquirySave(list).then((res) => {
        // this.getDetail(res.id, res.buyType);
        this.isRead = true;
        if (state == 1) {
          this.submitForm();
        } else {
          this.$message({
            message: "保存成功",
            type: "success",
          });
        }
      });
    },

    //商品列表点击查询
    onSubmit() {
      this.page.page = 1;
      this.getList();
    },
    //选中商品点击确定
    sureProduct() {
      this.tableData = this.buyProduct;
      this.dialogTableVisible = false;
    },
    //点击新增
    showDialog() {
      this.dialogTableVisible = true;
    },
    //请购单列表  点击选中
    handleSelectionChange(val) {
      this.dialogTableVisible = false;
      this.getDetail(val.id, val.buyType, 1);
    },
    //翻页
    changeSize(page) {
      this.page.page = page;
      this.getList();
    },
    //获取可购产品的列表
    getList() {
      let data = Object.assign(
        {
          isInquiry: "Y",
          isLast: "N",
        },
        this.formInline
      );
      wlcSysInquirySeletelist(data).then((res) => {
        this.productList = res;
      });
    },
    //点击上传文件
    uploadFile(file, fileList) {
      let type = file.name.split(".").pop();
      if (type == "png" || type == "jpg") {
      } else {
        this.$message({
          message: "请上传png,jpg格式的图片",
          type: "warming",
        });
        return;
      }
      if (file.size > 50 * 1024) {
        this.$message({
          message: "图片不可大于50kb",
          type: "warming",
        });
        return;
      }
      var data = new FormData();
      data.append("file", file.raw);
      bdInvbasdocUploadImage(data).then((res) => {
        this.$message({
          message: "上传成功",
          type: "success",
        });
        console.log(this.tableData[this.uploadData.index]);
        this.tableData[this.uploadData.index].inquiryProductUrl = res.filePath;
        this.$set(
          this.tableData[this.uploadData.index],
          "fileName",
          res.fileName
        );
      });
    },
    //获取选择文件的第几条数据上传附件
    getIndex(e) {
      this.uploadData.index = e.$index;
    },
    //删除文件
    removeFile(file, fileList) {
      console.log(file);
      console.log(fileList);
    },
    //点击审核
    approval() {
      wlcSysAllAuditSubmit(this.dataDetail).then((res) => {
        console.log(res);
      });
    },
    //获取草稿列表
    getDraft() {
      var data = {
        page: {},
      };
      wlcSysAllListByDraft({ isInquiry: "Y", type: 0 }).then((res) => {
        this.draftList = res;
      });
    },
    //获取供应商列表
    getSupple() {
      supplierList({
        page: {
          page: 1,
          pageSize: 10000,
        },
      }).then((res) => {
        this.supplierArr = res.records;
      });
    },
    //获取请购单详情
    getDetail(id, buyType, isNew) {
      wlcSysInquiryDetail({ allId: id }).then((res) => {
        // this.dataDetail = res;
        this.$set(this, "dataDetail", res);
        if (isNew) {
          this.dataDetail.type = "";
          this.isRead = false;
        } else {
          this.isRead = true;
        }
        var arr = res.wlcSysBack;
        // for (var i = 0; i < arr.length; i++) {
        //   if (arr[i].wlcSysBack) {
        //     for (var a in arr[i].wlcSysBack[0]) {
        //       // arr[i][a] = arr[i].wlcSysBack[0][a];
        //       this.$set(arr[i],a,arr[i].wlcSysBack[0][a]);
        //       arr[i].supplierString = arr[i].wlcSysBack[0].inquiryCustnameId
        //         ? arr[i].wlcSysBack[0].inquiryCustnameId +
        //           "," +
        //           arr[i].wlcSysBack[0].inquiryCustname
        //         : "";
        //     }
        //   }
        // }
        this.tableData = arr;
      });
    },
  },
};
</script>

<style lang="less" scoped>
.apply-data {
  display: flex;
  flex-wrap: wrap;
  .ad-item {
    display: flex;
    height: 30px;
    line-height: 30px;
    margin-right: 20px;
    align-items: center;
    width: 200px;
    color: #666;
    font-size: 14px;
  }
}
.sign-remarks {
  width: 100%;
  border-bottom: 1px solid #999;
  font-size: 14px;
  height: 40px;
  line-height: 40px;
  color: #333;
}
.sign-data {
  display: flex;
  .sd-item {
    flex: 1;
    color: #333;
  }
}
.showImgDiv {
  width: 100%;
  img {
    width: 100%;
  }
}
.page-size {
  text-align: right;
  margin-top: 10px;
}
</style>
<style lang="less">
.inquiryForm {
  .ad-item {
    .el-input__inner {
      height: 25px;
      line-height: 25px;
    }
    .el-input__suffix {
      line-height: 50px;
    }
  }
  .el-table--scrollable-x .el-table__body-wrapper {
    overflow: auto;
    max-height: 350px;
  }
}
</style>
